home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 22 / Cream of the Crop 22.iso / doom / quake2.zip / TF1_2SRC.ZIP / QUAKE / FORTRESS / SOURCE / MSKIN.QC < prev    next >
Text File  |  1996-09-10  |  2KB  |  78 lines

  1. /*
  2.     TeamFortress 1.2    -    7/9/96
  3.  
  4.     Robin Walker, John Cook, Ian Caughley.
  5.  
  6.     Functions specific to the Multiskin section of TeamFortress.
  7. */
  8.  
  9. // Prototypes
  10. void(float skinno) Multiskin_SetSkin;
  11. void() Multiskin_NextSkin;
  12. void() Multiskin_PrevSkin;
  13. void() Multiskin_DisplayName;
  14.  
  15. //=========================================================================
  16. // Set the Skin of the self entity to skinno
  17. void(float skinno) Multiskin_SetSkin =
  18. {
  19.     // If Classkin is on, prevent skin changes
  20.     if (!(toggleflags & TFLAG_SKIN))
  21.         return;
  22.  
  23.     if (skinno > MS_MAX_SKIN)
  24.     {
  25.         skinno = MS_MAX_SKIN;
  26.     }
  27.  
  28.     self.skin = skinno;
  29.     Multiskin_DisplayName();
  30. };
  31.  
  32. //=========================================================================
  33. // Increment the skin of the self entity
  34. void() Multiskin_NextSkin =
  35. {
  36.     // If Classkin is on, prevent skin changes
  37.     if (!(toggleflags & TFLAG_SKIN))
  38.         return;
  39.  
  40.     self.skin = self.skin + 1;
  41.  
  42.     if (self.skin > MS_MAX_SKIN)
  43.         self.skin = 0;
  44.  
  45.     Multiskin_DisplayName();
  46. };    
  47.  
  48. //=========================================================================
  49. // Decrement the skin of the self entity
  50. void() Multiskin_PrevSkin =
  51. {
  52.     // If Classkin is on, prevent skin changes
  53.     if (!(toggleflags & TFLAG_SKIN))
  54.         return;
  55.  
  56.     self.skin = self.skin - 1;
  57.  
  58.     if (self.skin < 0)
  59.         self.skin = MS_MAX_SKIN;
  60.  
  61.     Multiskin_DisplayName();
  62. };
  63.  
  64. //=========================================================================
  65. // Write a description of the self entity's current skin to the self entity
  66. void() Multiskin_DisplayName =
  67. {
  68.     local string sn;
  69.  
  70.     if (self.classname != "player")
  71.         return;
  72.  
  73.     // Display skin name
  74.     sprint(self, "Skin no ");
  75.     sn = ftos(self.skin);
  76.     sprint(self, sn);
  77.     sprint(self, ".\n");
  78. };